<template>
  <div>
    <ul>
      <li v-for="(v, i) in newhuod" :key="i">
        <div>
          <img :src="v.imgUrl" alt="" />
          <div class="neirong">
            <h4>{{ v.title }}</h4>
            <p>{{ v.cont }}</p>
            <span>{{ v.time }}</span>
          </div>
        </div>
        <div class="jian">{{ v.jian }}</div>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  data() {
    return {
      huodong: [],
    };
  },
  mounted() {
    // 页面加载完毕发送请求
    // 调用vuex的actions触发异步操作
    this.$store.dispatch("HUOD_DATA", { url: "user/life6/datamock" });
  },
  computed: {
    newhuod() {
      return this.$store.state.life.huodongobj.huodong;
    },
  },
};
</script>

<style lang="less" scoped>
ul {
  width: 94%;
  margin: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}
li {
  width: 100%;
  display: flex;
  justify-content: space-between;
  border-bottom: 0.01rem rgb(223, 223, 223) solid;
  font-size: 0.14rem;
  overflow: hidden;
  padding: 0.0083rem 0;
}
h4 {
  font-size: 0.14rem;
  color: #383838;
  margin-top: 0.0417rem;
}
p {
  font-size: 0.1rem;
}
span {
  display: block;
  font-size: 0.0333rem;
  margin-top: 0.3667rem;
  color: #1e649c;
}
img {
  float: left;

  padding: 0.0467rem 0.0167rem;
}
.neirong {
  max-width: 60%;
  float: left;
  margin-left: 0.0833rem;
  overflow: hidden;
}
.jian {
  font-size: 0.1rem;
  height: 0.2017rem;
  line-height: 0.2017rem;
  background-color: #e32f63;
  color: #fff;
  padding: 0 0.0417rem;
  text-align: center;
  border-radius: 5px;
  margin-top: 0.1417rem;
}
</style>